<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<p id="p" class="abc">你好</p>
<script>
/*
每一个节点都有三个特点:
1. nodeName
2. nodeValue
3. nodeType
 */
document.write("doucument 的 nodeName:" + document.nodeName +
    "<br> nodeTpye:" + document.nodeType +
    "<br> nodeValue:" + document.nodeValue)

var p = document.getElementById("p");
document.write("<br>" + p.nodeName + "<br>" +
    p.nodeValue + "<br>" + p.nodeType)

var text = p.firstChild;
document.write("<br>" + text.nodeName + "<br>" +   // #text
    text.nodeValue + "<br>" + text.nodeType)

var attrNode = p.getAttributeNode("class");
document.write("<br>" + attrNode.nodeName + "<br>" +
    attrNode.nodeValue + "<br>" + attrNode.nodeType)
</script>
</body>
</html>